<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateGoodsPriceTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods_price', function (Blueprint $table) {
            $table->increments('id');
            $table->timestamps();
            $table->integer('gid')->index();
            $table->float('price', 9, 2)->index();
            $table->float('discount_price', 9, 2)->index();
            $table->integer('storage')->default(0);
            $table->string('size', 30);
            $table->string('color', 30);
            $table->integer('salse')->default(0);
            $table->tinyInteger('is_discount')->default(2);
            $table->tinyInteger('state')->default(1);

            $table->string('attr1' ,50)->nullable();
            $table->string('attr2' ,100)->nullable();
            $table->string('attr3' ,150)->nullable();

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods_price');
    }
}
